#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;

int main() {
    int n, k, d;
    cin >> n >> k >> d;
    vector<int> arr(n + 1);
    for (int i = 1; i <= n; i++)
        cin >> arr[i];
    vector<vector<ll>> f(n + 1, vector<ll>(k + 1));
    auto g = f;

    ll ret = -0x3f3f3f;
    for (int i = 1; i <= n; i++) {
        f[i][1] = g[i][1] = arr[i];
        for (int j = 2; j <= min(i, k); j++) {
            g[i][j] = 0x3f3f;
            f[i][j] = -0x3f3f;
            for (int prev = max(i - d, j - 1); prev <= i - 1; prev++) {
                f[i][j] = max(f[i][j], max(f[prev][j - 1] * arr[i], g[prev][j - 1] * arr[i]));
                g[i][j] = min(g[i][j], min(f[prev][j - 1] * arr[i], g[prev][j - 1] * arr[i]));
            }
        }
    }
    for (int i = k; i <= n; i++) {
        ret = max(ret, f[i][k]);
    }
    cout << ret << endl;
    return 0;
}
